var thisview = null;
var indexview = null;
mui.init();
mui.plusReady(function(){
	thisview = plus.webview.currentWebview();
	indexview = plus.webview.getLaunchWebview();
});

mui('#userList').on('tap','.result_item',function(){
	var userid = this.getAttribute('id');
	new UserInfo().userId(userid);
	new UserInfo().imToken(meInfo[userid]);
	indexview.evalJS("initMain()");
	plus.nativeUI.showWaiting('登录中...', {
		padlock: true
	});//	plus.webview.getWebviewById('pages/friends.html').evalJS("displayId('"+userid+"')");
//	thisview.close();
});

var first = null;
mui.back = function() {
	//首次按键，提示‘再按一次退出应用’
	if (!first) {
		first = new Date().getTime();
		mui.toast('再按一次退出应用');
		setTimeout(function() {
			first = null;
		}, 1000);
	} else {
		if (new Date().getTime() - first < 1000) {
			plus.runtime.quit();
		}
	}
};
